Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[(maybe?)DON'T MERGE] Update pac #102

Closed
wants to merge 14 commits into from

Conversation

usbalbin
Copy link
Contributor

@usbalbin usbalbin commented Dec 16, 2023

#96 requires updates to the pac. However the new pac changes register blocks member fields to access methods.

Almost all this PR does is adding paranthesis to things like

- dac.dac_cr.modify(|_, w| w.$en().clear_bit());
+ dac.dac_cr().modify(|_, w| w.$en().clear_bit());

This PR currently uses stm32g4 from the nightly repo, I assume at some point a new version of the pac is released. We can then merge this PR(after updating it to depend on that released pac).

I will use this as a base when working on #96 for now..

Edit:
Now using stm32g4-staging

This was referenced Aug 7, 2024
@usbalbin
Copy link
Contributor Author

usbalbin commented Nov 7, 2024

@AdinAck this is now updated for stm32g4-staging v0.17.0

Edit: still some errors... - fixed

@AdinAck
Copy link
Contributor

AdinAck commented Nov 7, 2024

Awesome!! HRTIM support would be great!

This enables me to upstream the fully enforced Cordic interface, would you like me to do so?

src/fdcan.rs Outdated Show resolved Hide resolved
#[cfg(any(feature = "stm32g471", feature = "stm32g491", feature = "stm32g4a1"))]
opamps! {
Opamp1 => opamp1: {
vinm0: crate::gpio::gpioa::PA3<crate::gpio::Analog>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could reexport all pins from gpio::gpiox to gpio and get access by just gpio::PA3.

Comment on lines 212 to 217
dma.ifcr().write(|w| w
.[<ctcif $x>]().set_bit() //Clear transfer complete interrupt flag
.[<chtif $x>]().set_bit() //Clear half transfer interrupt flag
.[<cteif $x>]().set_bit() //Clear transfer error interrupt flag
.[<cgif $x>]().set_bit() //Clear global interrupt flag
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DMA can be fully demacrofied:

Suggested change
dma.ifcr().write(|w| w
.[<ctcif $x>]().set_bit() //Clear transfer complete interrupt flag
.[<chtif $x>]().set_bit() //Clear half transfer interrupt flag
.[<cteif $x>]().set_bit() //Clear transfer error interrupt flag
.[<cgif $x>]().set_bit() //Clear global interrupt flag
);
let num = Self::NUMBER as u8;
dma.ifcr().write(|w|{
w.ctcif(num).set_bit(); //Clear transfer complete interrupt flag
w.chtif(num).set_bit(); //Clear half transfer interrupt flag
w.cteif(num).set_bit(); //Clear transfer error interrupt flag
w.cgif(num).set_bit() //Clear global interrupt flag
});

@usbalbin usbalbin mentioned this pull request Nov 7, 2024
@usbalbin
Copy link
Contributor Author

usbalbin commented Nov 7, 2024

Awesome!! HRTIM support would be great!

This enables me to upstream the fully enforced Cordic interface, would you like me to do so?

What is the plan with regards to the pac? Is it going to be released soon (not staging) or are there potentially more things on the horizon until then? Not really sure how best to proceed here.

Should we merge this PR soonish and continue building on top of that? Or keep a separate experimental branch with new features requiring this new staging pac?

@usbalbin usbalbin changed the title [DON'T MERGE] Update pac [(maybe?)DON'T MERGE] Update pac Nov 7, 2024
@AdinAck
Copy link
Contributor

AdinAck commented Nov 8, 2024

Should we merge this PR soonish and continue building on top of that? Or keep a separate experimental branch with new features requiring this new staging pac?

A dev branch sounds like the best course of action to me. I think once the actual PAC is updated then we can merge it. But in the meantime I'd love to keep improving on peripheral interfaces with the staged PAC.

@burrbull
Copy link
Member

burrbull commented Nov 8, 2024

What is the plan with regards to the pac? Is it going to be released soon (not staging) or are there potentially more things on the horizon until then? Not really sure how best to proceed here.

Only @adamgreig can say something about this.

@usbalbin usbalbin mentioned this pull request Nov 8, 2024
@usbalbin
Copy link
Contributor Author

usbalbin commented Nov 8, 2024

I will close this in favor of #142. Thank you both :)

@usbalbin usbalbin closed this Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants